package com.jsd2412.backend.nurse.service.impl;

import com.jsd2412.backend.nurse.mapper.NurseMapper;
import com.jsd2412.backend.nurse.pojo.dto.ServiceProParam;
import com.jsd2412.backend.nurse.pojo.dto.ServiceProQuery;
import com.jsd2412.backend.nurse.pojo.entity.ServicePro;
import com.jsd2412.backend.nurse.pojo.vo.ProFreeTypeVO;
import com.jsd2412.backend.nurse.pojo.vo.ProTypeVO;
import com.jsd2412.backend.nurse.pojo.vo.ServiceProVO;
import com.jsd2412.backend.nurse.service.NurseService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.beans.Beans;
import java.util.List;

/**
 * 护理管理服务端
 */
@Service
public class NurseServiceImpl implements NurseService {
    @Autowired
    private NurseMapper nurseMapper;
    @Override
    public List<ServiceProVO> selectAllService(ServiceProQuery serviceProQuery) {
        List<ServiceProVO> serviceProVOS = nurseMapper.selectAll(serviceProQuery);
        return serviceProVOS;
    }

    @Override
    public void addServicePro(ServiceProParam serviceProParam) {
        ServicePro servicePro = new ServicePro();
        BeanUtils.copyProperties(serviceProParam,servicePro);
        nurseMapper.addServicePro(servicePro);
    }

    @Override
    public List<ProTypeVO> selectAllProType() {
        return nurseMapper.selectAllProType();
    }

    @Override
    public List<ProFreeTypeVO> selectAllProFreeType() {
        return nurseMapper.selectAllProFreeType();
    }
}
